package com.power.project.api;

import com.power.common.domain.PageDataResponse;
import com.power.common.domain.ResponseDTO;
import com.power.project.model.bo.UserRemoveBO;
import com.power.project.model.bo.UserSaveBO;
import com.power.project.model.pageInfo.UserQueryPageInfo;
import com.power.project.model.vo.DepartUserVO;
import com.power.project.model.vo.UserBaseVO;
import com.power.project.model.vo.UserDetailVO;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import javax.validation.Valid;

/**
 * Feign
 */
@Validated
public interface IWw_userFeign {

    /**
     * 查询所有成员列表
     */
    @GetMapping("/ww_user/list/all")
    ResponseDTO<PageDataResponse<DepartUserVO>> userList(@Valid UserQueryPageInfo pageInfo);

    /**
     * 根据部门id及分页信息查询部门成员列表
     */
    @GetMapping("/ww_user/list/departuser")
    ResponseDTO<PageDataResponse<DepartUserVO>> departUserList(@Valid UserQueryPageInfo pageInfo);

    /**
     * 根据标签id及分页信息查询标签成员列表
     */
    @GetMapping("/ww_user/list/taguser")
    ResponseDTO<PageDataResponse<UserBaseVO>> tagUserList(@Valid UserQueryPageInfo pageInfo);

    /**
     * 查看成员详情
     * @param userId ww_user.userid
     */
    @GetMapping("/ww_user/view")
    ResponseDTO<UserDetailVO> view(@RequestParam("userId") String userId);

    /**
     * 添加/编辑成员
     */
    @PostMapping("/ww_user/save")
    ResponseDTO<Void> save(@Valid @RequestBody UserSaveBO saveBO);

    /**
     * 人员管理中删除用户
     */
    @PostMapping("/ww_user/delete")
    ResponseDTO<Void> delete(@RequestParam("userId") String userId);

//    /**
//     * 从部门中删除成员
//     */
//    @PostMapping("/ww_user/remove")
//    ResponseDTO<Void> remove(@Valid @RequestBody UserRemoveBO removeBO);

    /**
     * 从部门中批量移除成员
     * @description 该接口也支持仅移除单个用户
     */
    @PostMapping("/ww_user/batchRemove")
    ResponseDTO<Void> batchRemove(@Valid @RequestBody UserRemoveBO removeBO);

}
